//
// Created by 束庆乐 on 2024/12/24.
//

#include <stdio.h>

int main50(){
    int arr[3] = {1,2,3};
    int *ptr = arr;
    //使用指针访问数组元素
    printf("arr[0]==%d,*ptr==%d\n",arr[0],*ptr);
    printf("arr[1]==%d,*(ptr+1)==%d\n",arr[1],*(ptr+1));
    printf("arr[2]==%d,*(ptr+2)==%d\n",arr[2],*(ptr+2));
    //修改数组元素
    arr[2] = 5;
    printf("arr[2]==%d,*(ptr+2)==%d\n",arr[2],*(ptr+2));
    //再次修改元素
    *(ptr+2) = 8;
    printf("arr[2]==%d,*(ptr+2)==%d\n",arr[2],*(ptr+2));

    return 0;
}
